﻿<%@ Page Title="单品有效值计算" Language="C#" MasterPageFile="~/master/m.master" %>
<script runat="server"></script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="../assets/css/shelf/base.css" rel="stylesheet">
<link href="../assets/css/report/AllocationDetail.css" rel="stylesheet" />
<link href="../assets/css/plugins/jQuery-DataTables/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
 <%--<link href="../assets/js/plugins/jQuery-DataTables/extensions/Select/css/select.bootstrap.min.css" rel="stylesheet" />--%>
<%--<link href="../assets/js/plugins/jQuery-DataTables/extensions/Buttons/css/buttons.bootstrap.min.css" rel="stylesheet" />--%>
    <link href="../assets/css/plugins/iCheck/customsmall.css" rel="stylesheet" />
    
    <link href="../assets/css/plugins/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" />

    <style>
        #search-artnum {display: inline-block;width: 355px;position: absolute;left: 58px;top: 5px;color: #333;background-color: #fff;border-color: #ccc; padding: 6px;border-radius: 3px;}
        #table{margin-top: 0 !important; border-left: 0; border-right: 0;}
        .bg_blue{ background-color: #110ffd;}
        .bg_green{ background-color: #07980e;}
        .bg_red{ background-color: #fe0402;}
        /*.condition1 label{ width: 40px; text-align: right;}
        .condition1 select{ width: 129px !important;display: inline-block;}
        .condition1 input{ display: inline-block;}
        .condition1 {padding: 2px 0}*/
        .condition-container {padding-bottom: 5px;}
        .dataTables_paginate { padding-right: 10px; padding-top: 5px;}
        .dataTables_paginate {padding-top: 15px;}
        .dataTables_scroll tr.selected {border-left: 4px solid #7acf89 !important;}
        .dataTables_scroll tr.selected td{background: #dff0d8 !important;color: #222121 !important;}
        .dataTables_scrollHead{ background-color: #ffffff;}
        .dataTables_wrapper {font-size: 12px;}
        .dataTables_wrapper div.dataTables_processing {top:210px !important;}
        .footer {width:100%;}
        .popLayer .glyphicon{ font-size: 12px;}
        .popLayer .glyphicon-arrow-down{left: 100px;top: -3px;}
        .popLayer .glyphicon-arrow-left{left: -11px;top: -45px;}
        .popLayer .glyphicon-arrow-right{top: -45px;left: 212px;}
        .popLayer .glyphicon-arrow-up{ left: 95px;top: -112px;}
        .popLayer .infoBtn .dot { -ms-border-radius: 24px; border-radius: 24px;height: 20px;width: 20px;display: inline-block; }
        .popLayer .infoBtn .tips{width: 50px;height: 20px;display: inline-block;position: relative;top: -5px;left: 4px;}
        .popLayer .infoBtn { position: relative; top: 45px; }
        .popLayer .infotitle {z-index: 2;color: #ffffff;text-align: center;left: 20px;width: 175px;position: relative;top: 10px; font-size: 12px; font-weight: normal !important;}
        .popLayer .infotitle span{ font-weight: bold;}
        .popLayer .weekinfo { width: 212px; display: inline-block;border: solid #000 1px;padding-left: 2px;}
        .popLayer .weekinfo .info { padding: 15px 0px 0px 0px; }
        .popLayer .weekinfo .info label { margin-bottom: 0px; font-weight: normal; font-size: 12px; }
        .popLayer .weekinfo .leftinfo { width: 104px;border-right: 1px solid #ffffff;}
        .popLayer .weekinfo .rightinfo { width: 104px;padding-left: 2px; }
        .popLayer .weekinfo .Botinfo{ width: 208px;padding:0px; }
        .popLayer .weekinfo .Botinfo label{ width: 100%;padding:0px; }
        .popLayer { padding-left: 5px; font-size: 12px;}
        .popLayer tr { height: 95px; }
        .popLayer tr td{ width: 224px; border: 1px solid #ffffff;}
        .system-box .right-side {overflow: hidden;}
        .system-box{ min-width: 940px;}
        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {padding: 2px;}
        .table-container{ background-color: #ffffff;}
        .yuce span{ color: #ffffff; padding-left: 2px; padding-right: 2px;margin-left: 1px; cursor: default;}
        .condition-container { padding-bottom: 0px; }

        .condition-container .row {margin-right: 0px;margin-left: 0px;}
        .condition-container .col-xs-3 { max-width: 235px;}
        .condition-container .form-group {margin-bottom: 0;}
        .condition-container .form-group label{margin-right: 3px;}
        /*下拉框覆盖样式*/
        .backselect{ color: #333;background-color: #fff;border-color: #ccc; padding: 5px 8px;}
        ul.dropdown-menu li { border: 1px solid #f1f1f1 }
        ul.dropdown-menu>li>a {margin: 0;}
        /*表头注脚*/
        .th-dot { -ms-border-radius: 16px; border-radius: 16px;height: 16px;width: 16px;display: inline-block;margin-bottom: -3px;margin-left: 10px; }
    
        .dataTables_scrollBody{ overflow-x: hidden !important;}
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
<div class="system-box">
	<div class="right-side">
        <div class="btns-container"></div>
        
	    <form class="form-horizontal">
	    <!--查询条件-->
		<div class="condition-container">
            <%--<div class="condition-title">查询条件</div>--%>
				<div class="row" style="overflow: visible;">
                 
				    <div class="form-group col-xs-3">
				        <label for="search-Area" class="control-label">区域</label>
				        <select id="search-Area" class="form-control selectpicker" data-width="150px" data-style="backselect"></select>
				    </div>
				    <div class="form-group col-xs-3">
				        <label for="search-Kind" class="control-label">大类</label>
				        <select id="search-Kind" class="form-control selectpicker"  data-width="150px" data-style="backselect" data-live-search="true" multiple></select>
				    </div>
				    <div class="form-group col-xs-3">
				        <label for="search-Item" class="control-label">子项</label>
				        <select id="search-Item" class="form-control selectpicker"  data-width="150px" data-style="backselect" data-live-search="true" multiple></select>
				    </div>
				    <div class="form-group col-xs-3">
				        <label for="search-Gender" class="control-label">性别</label>
				        <select id="search-Gender" class="form-control selectpicker"  data-width="150px" data-style="backselect"></select>		        
				    </div>

				</div>
		        <div class="" style="overflow: visible;">
		            <div class="form-group col-xs-3">
		                <label for="search-year" class="control-label">年份</label>
		                <select id="search-year" class="form-control selectpicker"  data-width="150px" data-style="backselect"></select>	
		            </div>
		            <div class="form-group col-xs-3">
		                <label for="search-season" class="control-label">季节</label>
		                <select id="search-season" class="form-control selectpicker"  data-width="150px" data-style="backselect"></select>	
		            </div>
		            <div class="form-group col-xs-3">
		                <label for="search-artnum" class="control-label">货号</label>
		                <input id="search-artnum" type="text" placeholder="多个货号以','隔开..." class="form-control" />
		            </div>

				</div>
			<div class="cb"></div>
		</div>
        </form>
        <div class="table-container no-padding">
             <table class="table table-bordered text-center" id="table" style="table-layout: fixed;"></table>
        </div>
		<%--<div class="pageControl"></div>--%>
        <div id="popContainer" style="display: none;">
            <div class="popLayer">
               
                <table>
                    <tr>
                        <td></td><td></td><td></td><td></td><td></td>
                    </tr>
                    <tr>
                        <td></td><td></td>
                        <td>
                            <div class="infoBtn">
                                <span class="dot bg_green"></span><span class="tips">有效</span>
                                <span class="dot bg_blue"></span><span class="tips">半有效</span>
                                <span class="dot bg_red"></span><span class="tips">无效</span>
                            </div>
                        </td>
                        <td></td><td></td>
                    </tr>
                    <tr>
                        <td></td><td></td><td></td><td></td><td></td>
                    </tr>
                    <tr>
                        <td></td><td></td><td></td><td></td><td></td>
                    </tr>
                </table>
               
            </div>
        </div>
	</div>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footer" Runat="Server">
<script src="../assets/js/framework.js"></script>
<script src="../assets/js/page/rScroll.js"></script>
<script src="../assets/js/page/pageControl.js"></script>
<script src="../assets/js/page/tableControl.js"></script>
<script src="../assets/js/plugins/iCheck/icheck.min.js"></script>
<script src="../assets/js/plugins/iCheck/icheckAll.js"></script>

<script src="../assets/js/plugins/jQuery-DataTables/jquery.dataTables.min.js"></script>
<script src="../assets/js/plugins/jQuery-DataTables/dataTables.bootstrap.js"></script>
<%--<script src="../assets/js/plugins/jQuery-DataTables/extensions/Select/js/dataTables.select.min.js"></script>--%>
<%--<script src="../assets/js/plugins/jQuery-DataTables/extensions/Buttons/js/dataTables.buttons.min.js"></script>--%>
    
<script src="../assets/js/plugins/bootstrap-select/bootstrap-select.min.js"></script>
<script src="../assets/js/plugins/bootstrap-select/i18n/defaults-zh_CN.min.js"></script>

<script>

    //诺米通用绑定下拉框
    var nmCommonBindList = function (controller, action, params, els, value, text, size,canNull, callback) {
        Y.API2(controller, action, params, function (data) {
            if (data.Success == false) {
                swal(data.Message, '', 'error');
            } else {
                var html = '';
                if (canNull) {
                    html = '<option value="">请选择</option>';
                }
                data.map(function (item) {
                    html += '<option value=' + item[value] + '>' + item[text] + '</option>';
                });
                els.map(function (item) {
                    $(item).empty();
                    $(item).html(html);
                    $(item).selectpicker({ size: size || 8, 'title': '请选择' });
                    $(item).selectpicker('refresh');
                });
                if (typeof callback === "function") {
                    callback();
                }
            }
        });
    }

    //区域
    var nmGetBasOperationAreaList = function (els, size, callback) {
        //nmCommonBindList('ShopPlanning', 'GetBasOperationAreaList', {}, els, 'OperationAreaName', 'OperationAreaName', size, true, callback);
        var value = 'OperationAreaName';
        Y.API2('ShopPlanning', 'GetBasOperationAreaList', {}, function (data) {
            if (data.Success == false) {
                swal(data.Message, '', 'error');
            } else {
                var html = '<option value="">请选择</option>';
                html += '<option value="全国">全国</option>';
                data.map(function (item) {
                    html += '<option value=' + item[value] + '>' + item[value] + '</option>';
                });
                els.map(function (item) {
                    $(item).append(html);
                    $(item).selectpicker({ size: size || 8, 'title': '请选择' });
                    $(item).selectpicker('refresh');
                });
                if (typeof callback === "function") {
                    callback();
                }
            }
        });
    }
    //大类
    var nmGetKindInfo = function (els, size, callback) {
        nmCommonBindList('Common', 'GetKindInfo', {}, els, 'KindID', 'KindName', size, false, callback);
    }
    //子项
    var nmGetItemInfo = function (els, params, size, callback) {
        nmCommonBindList('Common', 'GetItemInfo', { kindIds: params }, els, 'ItemorSub', 'ItemorSub', size, false, callback);
    }
    //性别
    var nmGetSexList = function (els, size, callback) {
        nmCommonBindList('Common', 'GetSexInfo', {}, els, 'SexId', 'SexName', size, true, callback);
    }
    //年份/季节
    var nmGetYearOrSeason = function (els, params, size, callback) {
        nmCommonBindList('DwGlobalVariable', 'GetGlobalVariableList', params, els, 'dictValue', 'dictName', size, true, callback);
    };

    $(document).ready(function () {

        //界面太大了，默认收起左边菜单
        $('.navbar-minimalize i', window.parent.document).click();

        //模块ID
        var ModuleID = Y.getUrlParam("ModuleID");
        //获取按钮
        commonUtil.loadBtnList(ModuleID, function () {
            $('.btns-container').append('<div style="clear: both;"></div>');
        });

        var Page = 1;
        var Size = 20;
        var mydraw = 0;
       
        nmGetBasOperationAreaList(['#search-Area']);
        nmGetKindInfo(['#search-Kind']);
        nmGetSexList(['#search-Gender']);
        nmGetYearOrSeason(['#search-year'], { dictValue: '年份' });
        nmGetYearOrSeason(['#search-season'], { dictValue: '季节' });


        //大类获取小类
        $(document).on("change", "#search-Kind", function () {
            //console.log("触发了原生的change事件!");
            $("#search-ItemID").html('<option value="">请选择</option>');
            var ids = $(this).val();
            if (ids == "" || ids == null) {
                $('#search-Item').empty();
                return;
            }
            nmGetItemInfo(['#search-Item'], ids.join(',')); //小品类
        });
        //没有数据也初始化一下表格
        $('#search-Item').selectpicker({ size: 6, 'title': '请选择' });
        $('#search-Item').selectpicker('refresh');
        /*========================================================================================*/

        //计算表格高度
        var ua = navigator.userAgent.toLowerCase();
        var calcTableHeight = function () {
            var tableHeight = 0;
            //开始时候表格可能没有初始化,取默认高度40
            var headHeight = $('.dataTables_scrollHead').outerHeight() || 40;
            //提供不同浏览器兼容计算
            if (ua.indexOf('chrome') > -1) {
                tableHeight = $('.right-side').outerHeight() - $('.btns-container').outerHeight() - $('.condition-container').outerHeight() - headHeight - 55;
            } else {
                tableHeight = $('.right-side').outerHeight() - $('.btns-container').outerHeight() - $('.condition-container').outerHeight() - headHeight - 55;
            }
            //必须用css方式设定，直接用.height()有时候会差60px
            $('.dataTables_scrollBody').css({ height: tableHeight + 'px' });
            return calcTableHeight;
        }

        /*========================================================================================*/

        var getColor = function(num) {
            if (num === "0") {
                return 'bg_green';
            } else if (num === "1") {
                return 'bg_blue';
            } else if (num === "2") {
                return 'bg_red';
            } else {
                return '';
            }
        }

        var table = null;
        var opts = {
            language: { url: "../assets/js/plugins/jQuery-DataTables/i18n/Chinese.json"},
            scrollX: false,
            searching: false,
            paging: true,
            info: false,
            ordering: false,
            lengthChange: false,
            processing: true,
            //autoWidth: true,
            pagingType: "full_numbers",
            scrollY: calcTableHeight(),//为了分页控件固定在下方
            scrollCollapse: false, //当显示更少的记录时，是否允许表格减少高度
            serverSide: true, //开启服务器分页模式
            pageLength: Size,
            initComplete: function (settings, json) {

                //表格初始化完毕立即计算一次
                calcTableHeight();
            },
            ajax: {
                url: '/api.ashx?c=GoodsSingleValidCalc&a=GetGoodsSingleValidCalcMatInfoList&u=',
                type: "POST",
                //data: {},//提交参数
                data: function (d) {
                    //debugger 
                    mydraw = d.draw;
                    d.Page = (d.start / d.length) + 1;
                    console.log("page=" + d.Page);
                    d.Size = d.length;
                },
                dataSrc: function (res) {//dataSrc函数应该return一个【实体数组】供渲染表格
                    if (res.Success === false) {
                        swal(res.Message, '', 'error');
                        return [];
                    } else {
                        var items = res.Data.Items;
                        for (var i = 0; i < items.length; i++) {
                            var infoArr = items[i].AfterInfoList;
                            var newInfo = '<div class="yuce">';
                            for (var j = 0; j < infoArr.length; j++) {
                                newInfo += '<span class="' + getColor(infoArr[j].AfterReturnValidType) + '">' + infoArr[j].WeekNo + '周</span>';
                            }
                            newInfo += '</div>';
                            res.Data.Items[i].NewInfos = newInfo;
                            res.Data.Items[i].RowId = i + 1;

                        };
                        //debugger 
                        Page = res.Data.Page;
                        res.draw = table.ajax.params().draw;
                        res.recordsTotal = res.Data.RecordCount;
                        res.recordsFiltered = res.Data.RecordCount;

                        return res.Data.Items;
                    }
                }
            },
            columns: [
                { title: "行号", "data": "RowId", "width": "42px", className: "text-center RowId", defaultContent: "", "visible": false },
                { title: "年份", "data": "OutYear", "width": "42px", className: "text-center YearV", defaultContent: "", "visible": false },
                { title: "区域", "data": "ParentAreaID", "width": "42px", className: "text-center ParentAreaID", defaultContent: "" },
                { title: "货品简称", "data": "MaterialShortName", className: "text-center ", defaultContent: "" },
                { title: "大类", "data": "KindName", "width": "40px", className: "text-center ", defaultContent: "" },
                { title: "子项", "data": "ItemOrSub", "width": "100px", className: "text-center ", defaultContent: "" },
                { title: "货号", "data": "MaterialID", "width": "115px", className: "text-center MaterialID", defaultContent: "" },
                { title: "性别", "data": "SexName", "width": "30px", className: "text-center ", defaultContent: ""},
                { title: "零售价", "data": "RetailPrice", "width": "65px", className: "text-center ", defaultContent: "" },
                { title: "订单属性", "data": "OrderAttribID", "width": "30px", className: "text-center ", defaultContent: "" },
                { title: "近一周畅滞销状态", "data": "AllCzpFlagNow", "width": "58px", className: "text-center ", defaultContent: "" },
                { title: "累计畅滞销状态", "data": "AllCzpFlag", "width": "58px", className: "text-center ", defaultContent: "" },
                { title: "标准陈列量", "data": "DisplayQty", "width": "40px", className: "text-center ", defaultContent: "" },
                {
                    title: "<div class=\"infoBtn\">未来三个月有效性预测" +
                        "<span class=\"th-dot bg_green\"></span><span class=\"tips\">有效</span>" +
                        "<span class=\"th-dot bg_blue\"></span><span class=\"tips\">半有效</span>" +
                        "<span class=\"th-dot bg_red\"></span><span class=\"tips\">无效</span>" +
                        "</div>", "data": "NewInfos", "width": "420px", className: "text-center ", defaultContent: ""}
            ]
        }
        table = $('#table').DataTable(opts);

        //加载列表数据
        var loadList = function () {

            var kindArr = $('#search-Kind').val();
            var kinds = ""; 
            if (kindArr != null) {
                kinds = kindArr.join(',');
            }

            var itemArr = $('#search-Item').val();
            var items = "";
            if (itemArr != null) {
                items = itemArr.join(',');
            }


            table.settings()[0].ajax.data = function (d) {
                    d.ParentAreaID = $('#search-Area').val();
                    d.KindID = kinds;
                    d.ItemOrSub = items;
                    d.YearNo = $('#search-year').val();
                    d.SeasonID = $('#search-season').val();
                    d.SexID = $('#search-Gender').val();
                    d.MaterialID = $('#search-artnum').val();

                    mydraw = d.draw;
                    d.Page = (d.start / d.length) + 1;
                    console.log("page=" + d.Page);
                    d.Size = d.length;
                },


            table.ajax.reload(function () {
                //debugger 
                //重新计算列宽
                table.columns.adjust().draw();

            }, true);
            //debugger
        }

        //查询按钮
        $('.btns-container').on('click', '#btn-search', function () {
            Page = 1;
            loadList();
        });


        $('.btns-container').on('click', '#calculateBtn', function () {
            layer.msg('正在计算，请耐心等待',
                {
                    icon: 16,
                    shade: 0.5,
                    time: 0,
                    maxWidth: 200,
                    area: ['230px', '75px']
                });

            Y.API2("GoodsSingleValidCalc", "CalculateGoodsSingleValidCalc", {}, function (data) {
                layer.closeAll('dialog');
                if (data.Success == false) {
                    swal(data.Message, '', 'error');
                } else {
                    //table.clear();
                    loadList();
                }
            });
        });

        var selectedRow = "0";
        var getDetail = function (parentAreaId, materialId, year )
        {
            Y.API2("GoodsSingleValidCalc", "GetGoodsSingleValidCalcAfterInfoList", { "ParentAreaID": parentAreaId, "MaterialID": materialId, "YearV": year }, function (data) {
                if (data.Success == false) {
                    swal("无法查看详细：" + data.Message, '', 'error');
                } else {
                    //非弹窗时候，popLayer只有一个
                  //var tds=  $('.popLayer').find('.infotitle').parent('td');

                    var incons = ['right', 'right', 'right', 'right', 'down', 'down', 'down', 'left', 'left', 'left', 'left', 'up', ''];
                    var tdIndexs = [0, 1, 2, 3, 4, 9, 14, 19, 18, 17, 16, 15, 10];
                    var tds = $('.popLayer').find('td');
                    for (var i = 0; i < data.length; i++) {
                         
                        var tdHtml = '\
                            <div class="infotitle '+ getColor(data[i].AfterReturnValidType) + ' ">第<span>' + data[i].WeekNo + '</span>周 店数:' + data[i].ShopCount +'</div>\
                            <div class="weekinfo">\
                                <div class="col-xs-5 info leftinfo">\
                                     <label>期初库存:'+ data[i].InitQty + '</label>\
                                    <label>预计回货:'+ data[i].ReturnQty +'</label>\
                                </div>\
                                <div class="col-xs-7 info rightinfo">\
                                    <label>预计销售:'+ data[i].PlanSaleQty + '</label>\
                                    <label>有效数量:'+ data[i].AfterReturnValidQty +'</label>\
                                </div>\
                                <div class="col-xs-12 info Botinfo" style="padding-top: 0px;" >\
                                    <label class="col-xs-12">结存数量:'+ data[i].BalanceQty +'</label>\
                                    <label class="col-xs-12">有效金额:'+ data[i].AfterReturnValidTagAmount +'</label>\
                                </div>\
                            </div>\
                            <div style="height: 0px;">\
                                <div class="glyphicon glyphicon-arrow-'+ incons[i] +'"></div>\
                            </div>';

                        $(tds[tdIndexs[i]]).html(tdHtml);
                    }

                    layer.open({
                        type: 1,
                        skin: 'layui-layer-demo', //样式类名
                        anim: 2,
                        title: "未来三个月有效性预测详情",
                        area: ['1115px', '500px'],
                        shadeClose: true, //开启遮罩关闭
                        content: $('#popContainer').html(),
                        end: function (index, layero) {
                            selectedRow = "0";
                        } 
                    });
                }
            });
        }

        //单行点击高亮
        $('#table').on('click', 'tr', function () {
            table.$('tr').removeClass('selected');
            $(this).addClass('selected');
        });

   
        //单行点击高亮
        $('#table').on('click', '.yuce', function () {
            //获取当前行高亮
            var tr = $(this).parents('tr');
            $(tr).addClass('selected');

            //获取行号
            var currentRow = $(tr).find('.RowId').text();
            //如果是重复的就不再继续了，防止双击出现两个弹窗
            if (selectedRow == currentRow) {
                selectedRow = currentRow;
                return false;
            }

            selectedRow = currentRow;
            //获取选中行

            var parentAreaId = $(tr).find('.ParentAreaID').text();
            var materialId = $(tr).find('.MaterialID').text();
            var year = $(tr).find('.YearV').text();
            getDetail(parentAreaId, materialId, year);
        });

        //重新计算表格高度
        $(window).resize(function () {
            calcTableHeight();
            //重新计算列宽
            //table.columns.adjust().draw();
        });

        calcTableHeight();

        //导出
        $(document).on("click", "#exportBtn", function () {
            var conditionsArr = [];

            var kindArr = $('#search-Kind').val();
            var kinds = "";
            if (kindArr != null) {
                kinds = kindArr.join(',');
            }

            var itemArr = $('#search-Item').val();
            var items = "";
            if (itemArr != null) {
                items = itemArr.join(',');
            }

            var parentAreaID = $('#search-Area').val();
            var yearNo = $('#search-year').val();
            var seasonName = $('#search-season').val();
            var sexID = $('#search-Gender').val();

            var materialIDStr = $('#search-artnum').val();

            if (!Y.checkNull(kinds)) {
                conditionsArr.push({ connector: "and", column: "mat.KindID", operator: "in_shopids", value: kinds});
            }
            if (!Y.checkNull(items)) {
                conditionsArr.push({ connector: "and", column: "mat.ItemOrSub", operator: "in_shopids", value: items });
            }
            if (!Y.checkNull(parentAreaID)) {
                conditionsArr.push({ connector: "and", column: "mat.ParentAreaID", operator: "=", value: parentAreaID });
            }
            if (!Y.checkNull(yearNo)) {
                conditionsArr.push({ connector: "and", column: "mater.YearNo", operator: "=", value: yearNo });
            }
            if (!Y.checkNull(seasonName)) {
                conditionsArr.push({ connector: "and", column: "mater.seasonName", operator: "=", value: seasonName });
            }
            if (!Y.checkNull(sexID)) {
                conditionsArr.push({ connector: "and", column: "mat.SexID", operator: "=", value: sexID });
            }
            if (!Y.checkNull(materialIDStr)) {
                conditionsArr.push({ connector: "and", column: "mat.MaterialID", operator: "in_shopids", value: materialIDStr });
            }
            conditionsArr = JSON.stringify(conditionsArr);
            var tempParam = {};
            tempParam.filename = "单品有效计算";
            tempParam.filetype = "GOODSSINGLEVALIDCALC";
            tempParam.conditions = encodeURIComponent(conditionsArr);
            var t = $.Export(tempParam);
        });
    })
</script>
</asp:Content>

